package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkMachseedingMapper;
import com.ruoyi.process.domain.WorkMachseeding;
import com.ruoyi.process.service.IWorkMachseedingService;

/**
 * 机器播种管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkMachseedingServiceImpl implements IWorkMachseedingService
{
    @Autowired
    private WorkMachseedingMapper workMachseedingMapper;

    @Override
    public List<WorkMachseeding> selectWorkMachseedingByuserId(Long userId)
    {
        return workMachseedingMapper.selectWorkMachseedingByuserId(userId);
    }

    /**
     * 查询机器播种管理
     *
     * @param workMachseedingId 机器播种管理ID
     * @return 机器播种管理
     */
    @Override
    public WorkMachseeding selectWorkMachseedingById(Long workMachseedingId)
    {
        return workMachseedingMapper.selectWorkMachseedingById(workMachseedingId);
    }

    /**
     * 查询机器播种管理列表
     *
     * @param workMachseeding 机器播种管理
     * @return 机器播种管理
     */
    @Override
    public List<WorkMachseeding> selectWorkMachseedingList(WorkMachseeding workMachseeding)
    {
        return workMachseedingMapper.selectWorkMachseedingList(workMachseeding);
    }

    /**
     * 新增机器播种管理
     *
     * @param workMachseeding 机器播种管理
     * @return 结果
     */
    @Override
    public int insertWorkMachseeding(WorkMachseeding workMachseeding)
    {
        workMachseeding.setCreateTime(DateUtils.getNowDate());
        return workMachseedingMapper.insertWorkMachseeding(workMachseeding);
    }

    /**
     * 修改机器播种管理
     *
     * @param workMachseeding 机器播种管理
     * @return 结果
     */
    @Override
    public int updateWorkMachseeding(WorkMachseeding workMachseeding)
    {
        workMachseeding.setUpdateTime(DateUtils.getNowDate());
        return workMachseedingMapper.updateWorkMachseeding(workMachseeding);
    }

    /**
     * 批量删除机器播种管理
     *
     * @param workMachseedingIds 需要删除的机器播种管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkMachseedingByIds(Long[] workMachseedingIds)
    {
        return workMachseedingMapper.deleteWorkMachseedingByIds(workMachseedingIds);
    }

    /**
     * 删除机器播种管理信息
     *
     * @param workMachseedingId 机器播种管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkMachseedingById(Long workMachseedingId)
    {
        return workMachseedingMapper.deleteWorkMachseedingById(workMachseedingId);
    }
}
